package com.myidis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.myidis.entity.AnalysisTheme;
import com.myidis.servlet.SubjectAnalyticServlet;

@Controller
@RequestMapping("/subjectAnalytic")
public class SubjectAnalyticController {
	@Autowired
	private SubjectAnalyticServlet subjectAnalyticServlet;
	
	@ResponseBody
	@RequestMapping("/list")
	public List<AnalysisTheme> list(){
		return subjectAnalyticServlet.all();
	}

	@ResponseBody
	@RequestMapping("/detail")
	public List<AnalysisTheme> detail(){
		return subjectAnalyticServlet.detail();
	}

	@ResponseBody
	@RequestMapping("/add")
	public int add(@RequestBody AnalysisTheme add){
		return subjectAnalyticServlet.add(add);
	}
	
	@ResponseBody
	@RequestMapping("/cha")
	public int upd(@RequestBody AnalysisTheme upd){
		return subjectAnalyticServlet.update(upd);
	}
	
	@ResponseBody
	@RequestMapping("/del")
	public int del(@RequestBody AnalysisTheme del){
		return subjectAnalyticServlet.delete(del);
	}
}